package com.arpa.wms.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * 自定义报表单据类型
 *  0 库存明细，
 *  1 出库流水，
 *  2 入库流水
 */
public enum DiyReportEnum implements IEnum<Integer> {
    /**
     * 自定义报表单据类型
     */
    INVENTORY_REPORT(0, "库存明细"),
    OUTBOUND_REPORT(1, "出库流水"),
    INBOUND_REPORT(2, "入库流水");

    /**
     * 值
     */
    private final Integer value;

    /**
     * 描述
     */
    private final String desc;

    DiyReportEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
    private static final Map<Integer, DiyReportEnum> ENUM_MAP = new HashMap();

    static {
        DiyReportEnum[] values = values();
        int length = values.length;
        for(int i = 0; i < length; i++){
            DiyReportEnum value1 = values[i];
            ENUM_MAP.put(value1.getValue(),value1);
        }
    }


    public static DiyReportEnum getEnumByValue(String value){

        return ENUM_MAP.get(value);
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
